<?php
foreach ($this->data as $item) {
?>
	<tr id="<? echo 'row'.$item['DEALCATEGORYID']?>" class="<?= 'child-row-'.$this->parentRow ?>" style="display: none">
		<td style="text-align: center;padding-left: 0">
			<input id="<?=$item['DEALCATEGORYID'] ?>" type="checkbox" name="ITEM[]" value="<?=$item['DEALCATEGORYID'] ?>" />
		</td>
		<td> 
			<div>
			<? if($item['SUBCOUNT']!=0){ ?>
				<div class="expand-icon"></div>
				<a class="expandable-table-category-name" style="padding-left: <? echo ($this->level * 10).'px'?>;font-size: <?= 14-2*$this->level?>px;" href="javascript:collapse(<?=$item['DEALCATEGORYID'] ?>,<?= $this->data + 1?>)"><b><?=$item['NAME']; ?></b></a>
			<? } else { ?>
				<div class="expand-icon-blank"></div>
				<div class="unexpandable-table-category-name" style="padding-left: <? echo ($this->level * 40).'px'?>;font-size: <?= 14-2*$this->level?>px;"><b><?=$item['NAME']; ?></b></div>
			<? } ?>
			</div>
		</td>
		<td style="text-align: center;padding-left: 0"> 
			<div>
				<?=$item['SUBCOUNT']; ?>
			</div>
		</td>
		<td style="text-align: center;padding-left: 0">
			<span id="status<?=$item['DEALCATEGORYID']?>">
				<? if($item['STATUS']!='1') { ?>
					<a href="#" onClick="changeStatus(<?=$item['DEALCATEGORYID'] ?>,1)">Inactive</a>
				<?} else {?>
					<a href="#" onClick="changeStatus(<?=$item['DEALCATEGORYID'] ?>,0)">Active</a>
				<?}?>
			</span>
		</td>
		<td style="text-align: center;padding-left: 0"> 
			<div>
			<select id="<?php echo 'actionbox'.$item['DEALCATEGORYID'] ?>" name="<?php echo 'actionbox'.$item['DEALCATEGORYID'] ?>" onchange="chooseAction(<?=$item['DEALCATEGORYID'] ?>)">
				<option value="0" >Choose an Action</option>
				<option value="<?=$item['DEALCATEGORYID'] ?>" >Edit</option>
				<option value="<?=$item['DEALCATEGORYID'] ?>" >Delete</option>
				<option value="<?=$item['DEALCATEGORYID'] ?>" >Add Sub Category</option>
			</select>
			</div>
		</td>
	</tr>
	<? if($item['SUBCOUNT']!=0){ ?>
	<tr id="<? echo 'row-ajax'.$item['DEALCATEGORYID']?>" style="display: none;text-align: center" class="row-ajax-loading">
		<td colspan="5" style="text-align: center;border: 0px">
			<div class="loading-ajax-img"></div>
		</td>
	</tr>
	<? } ?>
<? }?>